package com.example.leetcode.bfs;

import com.example.leetcode.bfs.common.BFSUtils;
import com.example.leetcode.tree.common.TreeNode;
import com.example.leetcode.tree.common.TreeUtils;

import java.util.List;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution515 {
    public List<Integer> largestValues(TreeNode root) {
        return BFSUtils.largestValues(root);
    }
}

public class leetcode515 {
    public static void main(String[] args) {
        Solution515 solution515 = new Solution515();
        Integer[] nums = {1, 3, 2, 5, 3, null, 9};
        System.out.println(solution515.largestValues(TreeUtils.generateLeetcodeTree(nums)));
    }
}
